/* 8911106 302933981 Ofri Keidar */

/******************************************************************************
* Student Name: Ofri Keidar
* Exercise Name: Ex6
* File Description: Class TooManyOrderedError's interface. TooManyOrderedError
* 					is an exceptions raised when trying to sell an item that
* 					exists in catalog but wanted amount is greater in more than
* 					10 than amount in stock. The class is derived from MyInventoryException
******************************************************************************/


#ifndef TOOMANYORDEREDERROR_H_
#define TOOMANYORDEREDERROR_H_
#include "MyInventoryException.h"

class TooManyOrderedError: public MyInventoryException {
protected:
	short m_invalidItem; // invalid item number
	unsigned int m_invalidAmount; // invalid ordered amount

public:
	/***************************************************************************************
	* function name: TooManyOrderedError(const short invalidItem, const unsigned int invalidAmount)
	* The Input: Invalid item number and invalid ordered amount
	* The output: None
	* The Function operation: Creates a new ItemExistsError object
	***************************************************************************************/
	TooManyOrderedError(const short invalidItem, const unsigned int invalidAmount);

	/***************************************************************************************
	* function name: TooManyOrderedError(const TooManyOrderedError& excpToCopy)
	* The Input: TooManyOrderedError object to be copied
	* The output: None
	* The Function operation: Creates a new TooManyOrderedError object that its m_errorMsg
	* 					      attribute points at NULL, since its error message will be
	* 					      set when calling to what()
	***************************************************************************************/
	TooManyOrderedError(const TooManyOrderedError& excpToCopy);

	/***************************************************************************************
	* function name: ~TooManyOrderedError() throw()
	* The Input: None
	* The output: None
	* The Function operation: Destructs TooManyOrderedError object. Empty implementation since
	* 						  TooManyOrderedError's members are of primitive type
	***************************************************************************************/
	~TooManyOrderedError() throw() {}

	/***************************************************************************************
	* function name: const char* what()
	* The Input: None
	* The output: Error message
	* The Function operation: Creates an error message according to exception's attributes
	* 					      and returns it
	***************************************************************************************/
	const char* what();


};


#endif
